The present invention relates generally to the field of source code management, and more particularly to identification of “related code segments” (that is, portions of code that are potentially related for code revision purposes). Oftentimes during software development, a developer will change a portion of a set of code associated with a computer program. Further, the set of code, or code base, may include several branches associated with various versions of the program. When making a change to a portion of code within a code base, the software developer may attempt to identify other portions of code within the code base where a similar change may be helpful.
When searching for related code segments that are similar to a given piece of code (herein referred to as a “target code segment”), then software developers typically: (i) search a code base manually in order to find related code segments that are related to the target code segment; and (ii) analyze the related code segments to determine whether each of those related code segments would benefit from the same type of change that is being proposed for the target code segment. For example, a review of one of the related code segments, which is related to the target code segment might show that the related portion had already undergone a change similar to what is currently proposed for the target code segment, but, that the related code segment had later been reverted back to a state similar to the target code segment for some reason. In that example, the reversion of the related code segment might: (i) cause the developer to question whether the currently proposed revision really would be helpful for that related code segment; and/or (ii) cause the developers to question whether the change being proposed for the target code segment would really be helpful even with respect to the target code segment.
When performing the manual searches for related code segments described in the previous paragraph, developers search change repositories for the exact words used in a code to determine whether the same change was made elsewhere. Another known technique to find related code segments is the application of an automated, static analysis rule using exact words or phrases (also known as a code snippet) that are searched over the entire code base.
Some known software development systems provide for an integrated development environment (IDE) that notifies the developer in real-time, as a piece of code is being written, that there is already a piece of code in a repository that includes the exact words or phrases being written by using a static analysis of the code language. Some IDEs notify the user that another version of the edited file had been modified using the exact words or phrases found in the edited file by applying those exact words or phrases in a static analysis of the other version.